package com.onlineMIS.ORM.entity.headQ.report;

import java.util.Comparator;

import com.onlineMIS.common.Common_util;

public class HeadQUnitSalesReportVO implements Comparable<HeadQUnitSalesReportVO>{
	
	/**客户id */
	private int clientId;
	/**客户姓名 */
	private String clientName;
	/**客户店铺名称 */
	private String storeName;
	/**销售数量 */
	private int totalQuantity;
	/**销售金额 */
	private double totalWholePrice;
	/**成本金额 */
	private double totalRecCost;
	/**退货数量 */
	private int totalQuantityR;
	/**退货销售金额 */
	private double totalWholePriceR;
	/**退货成本金额 */
	private double totalRecCostR;
	/**退货率*/
	private double returnRate;
	/**合计数量 */
	private int sumQuantity;
	/**合计销售额 */
	private double sumWholePrice;
	/**销售代卖数量 */
	private int dmQuantity;
	/**退货代卖数量 */
	private int dmQuantityR;
	/**合计代卖数量 */
	private int sumDmQuantity;
	/**销售代卖金额 */
	private double dmNetSalesAmount;
	/**退货代卖金额 */
	private double dmNetSalesAmountR;
	/**合计代卖金额 */
	private double sumDmNetSalesAmount;
	/**销售买断数量 */
	private int mdQuantiry;
	/**退回买断数量 */
	private int mdQuantiryR;
	/**合计买断数量 */
	private int sumMdQuantity;
	/**销售买断金额 */
	private double mdNetSalesAmount;
	/**退货买断金额 */
	private double mdNetSalesAmountR;	
	/**合计买断金额 */
	private double sumMdNetSalesAmount;
	/**客户单价详情ids  */
	private String orderIds;
	
	public HeadQUnitSalesReportVO(int clientId, String clientName, String storeName, int totalQuantity,
			double totalWholePrice, double totalRetailPrice, int totalQuantityR,double totalRetailPriceR, double totalWholePriceR,
			int dmQuantity, double dmNetSalesAmount, int mdQuantiry, double mdNetSalesAmount, String orderIds) {
		super();
		this.clientId = clientId;
		this.clientName = clientName;
		this.storeName = storeName;
		this.totalQuantity = totalQuantity;
		this.totalWholePrice = totalWholePrice;
		this.totalRecCost = totalRetailPrice;
		this.totalQuantityR = totalQuantityR;
		this.totalRecCostR = totalRetailPriceR;
		this.totalWholePriceR = totalWholePriceR;		
		this.sumQuantity = this.totalQuantity - this.totalQuantityR;
		this.sumWholePrice = this.totalWholePrice - this.totalWholePriceR;
		this.dmQuantity = dmQuantity;
		this.dmNetSalesAmount = dmNetSalesAmount;
		this.mdQuantiry = mdQuantiry;
		this.mdNetSalesAmount = mdNetSalesAmount;				
		this.orderIds = orderIds;
	}
	
	public HeadQUnitSalesReportVO() {
		super();
	}

	public int getClientId() {
		return clientId;
	}
	public void setClientId(int clientId) {
		this.clientId = clientId;
	}
	public String getClientName() {
		return clientName;
	}
	public void setClientName(String clientName) {
		this.clientName = clientName;
	}
	public String getStoreName() {
		return storeName;
	}
	public void setStoreName(String storeName) {
		this.storeName = storeName;
	}
	public int getTotalQuantity() {
		return totalQuantity;
	}
	public void setTotalQuantity(int totalQuantity) {
		this.totalQuantity = totalQuantity;
	}
	public double getTotalWholePrice() {
		return totalWholePrice;
	}
	public void setTotalWholePrice(double totalWholePrice) {
		this.totalWholePrice = totalWholePrice;
	}

	public int getTotalQuantityR() {
		return totalQuantityR;
	}
	public void setTotalQuantityR(int totalQuantityR) {
		this.totalQuantityR = totalQuantityR;
	}
	public double getTotalWholePriceR() {
		return totalWholePriceR;
	}
	public void setTotalWholePriceR(double totalWholePriceR) {
		this.totalWholePriceR = totalWholePriceR;
	}
	public int getSumQuantity() {
		return sumQuantity;
	}
	public void setSumQuantity(int sumQuantity) {
		this.sumQuantity = sumQuantity;
	}
	public double getSumWholePrice() {
		return sumWholePrice;
	}
	public void setSumWholePrice(double sumWholePrice) {
		this.sumWholePrice = sumWholePrice;
	}
	public String getOrderIds() {
		return orderIds;
	}
	public void setOrderIds(String orderIds) {
		this.orderIds = orderIds;
	}
	public double getDmNetSalesAmount() {
		return dmNetSalesAmount;
	}
	public void setDmNetSalesAmount(double dmNetSalesAmount) {
		this.dmNetSalesAmount = dmNetSalesAmount;
	}
	public int getMdQuantiry() {
		return mdQuantiry;
	}
	public void setMdQuantiry(int mdQuantiry) {
		this.mdQuantiry = mdQuantiry;
	}
	public double getMdNetSalesAmount() {
		return mdNetSalesAmount;
	}
	public void setMdNetSalesAmount(double mdNetSalesAmount) {
		this.mdNetSalesAmount = mdNetSalesAmount;
	}

	public double getTotalRecCost() {
		return totalRecCost;
	}

	public void setTotalRecCost(double totalRecCost) {
		this.totalRecCost = totalRecCost;
	}

	public double getTotalRecCostR() {
		return totalRecCostR;
	}

	public void setTotalRecCostR(double totalRecCostR) {
		this.totalRecCostR = totalRecCostR;
	}

	public int getdmQuantityR() {
		return dmQuantityR;
	}

	public void setdmQuantityR(int dmQuantityR) {
		this.dmQuantityR = dmQuantityR;
	}

	public double getDmNetSalesAmountR() {
		return dmNetSalesAmountR;
	}

	public void setDmNetSalesAmountR(double dmNetSalesAmountR) {
		this.dmNetSalesAmountR = dmNetSalesAmountR;
	}

	public int getMdQuantiryR() {
		return mdQuantiryR;
	}

	public void setMdQuantiryR(int mdQuantiryR) {
		this.mdQuantiryR = mdQuantiryR;
	}

	public double getMdNetSalesAmountR() {
		return mdNetSalesAmountR;
	}

	public void setMdNetSalesAmountR(double mdNetSalesAmountR) {
		this.mdNetSalesAmountR = mdNetSalesAmountR;
	}

	public int getDmQuantity() {
		return dmQuantity;
	}

	public void setDmQuantity(int dmQuantity) {
		this.dmQuantity = dmQuantity;
	}

	public int getDmQuantityR() {
		return dmQuantityR;
	}

	public void setDmQuantityR(int dmQuantityR) {
		this.dmQuantityR = dmQuantityR;
	}

	public int getSumDmQuantity() {
		return sumDmQuantity;
	}

	public void setSumDmQuantity(int sumDmQuantity) {
		this.sumDmQuantity = sumDmQuantity;
	}

	public void setSumDmNetSalesAmount(int sumDmNetSalesAmount) {
		this.sumDmNetSalesAmount = sumDmNetSalesAmount;
	}

	public int getSumMdQuantity() {
		return sumMdQuantity;
	}

	public void setSumMdQuantity(int sumMdQuantity) {
		this.sumMdQuantity = sumMdQuantity;
	}
	public void setSumMdNetSalesAmount(int sumMdNetSalesAmount) {
		this.sumMdNetSalesAmount = sumMdNetSalesAmount;
	}

	public double getSumDmNetSalesAmount() {
		return sumDmNetSalesAmount;
	}

	public void setSumDmNetSalesAmount(double sumDmNetSalesAmount) {
		this.sumDmNetSalesAmount = sumDmNetSalesAmount;
	}

	public double getSumMdNetSalesAmount() {
		return sumMdNetSalesAmount;
	}

	public void setSumMdNetSalesAmount(double sumMdNetSalesAmount) {
		this.sumMdNetSalesAmount = sumMdNetSalesAmount;
	}
	
	public double getReturnRate() {
		return returnRate;
	}

	public void setReturnRate(double returnRate) {
		this.returnRate = returnRate;
	}

	//计算退货率
	public void countReturnRate() {
		if(this.totalWholePriceR ==0 && this.totalWholePrice==0) {
			this.returnRate = 0.0;
		}else if ( this.totalWholePrice==0) {
			this.returnRate = 0.0;
		}else {
			this.returnRate = Common_util.getFormatDouble(this.totalWholePriceR/this.totalWholePrice)*100;			
		}
		
	}

	@Override
	public int compareTo(HeadQUnitSalesReportVO o) {
		return this.getClientName().compareTo(o.getClientName());
	}
	
	
}
